#include "Scheme/GUILayerStandard.h"

namespace YGUI
{
    LayerStandard::LayerStandard(unsigned int priority) : m_priority(priority)
    {
    }

    void LayerStandard::render(Window& wnd, const ColourRect* modcolor/* = 0*/, const Rect<float>* clipper/* = 0*/) const
    {
        for(SectionList::const_iterator it = m_sections.begin(); it != m_sections.end(); ++it)
        {
            (*it).render(wnd, modcolor, clipper);
        }
    }

    void LayerStandard::render(Window& wnd, const Rect<float>& base_rect, const ColourRect* modcolor/* = 0*/, const Rect<float>* clipper/* = 0*/) const
    {
        for(SectionList::const_iterator it = m_sections.begin(); it != m_sections.end(); ++it)
        {
            (*it).render(wnd, base_rect, modcolor, clipper);
        }
    }

    unsigned int LayerStandard::getPriority(void) const
    {
        return m_priority;
    }

    void LayerStandard::setPriority(unsigned int priority)
    {
        m_priority = priority;
    }

    void LayerStandard::addSection(const SectionStandard& section)
    {
        m_sections.push_back(section);
    }

    void LayerStandard::clearSection(void)
    {
        m_sections.clear();
    }

    bool LayerStandard::operator < (const YGUI::LayerStandard &layer) const
    {
        return m_priority < layer.m_priority;
    }
};